package com.ruibang.glass.produce.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 溶解缺陷取样项目
 * </p>
 *
 * @author songJinKang
 * @since 2024-04-28
 */
@Data
@ApiModel(value = "溶解缺陷取样项目")
@TableName("g_produce_defect_sample_item")
@JsonIgnoreProperties(value = {"dataTime"}, allowGetters = true)
public class DefectSampleItem {
    @ApiModelProperty(value = "主键ID")
    @TableId(value = "sample_item_id", type = IdType.ASSIGN_ID)
    private String sampleItemId;
    @ApiModelProperty(value = "样品ID")
    private String sampleId;
    @ApiModelProperty(value = "缺陷类型")
    @NotBlank(message = "缺陷类型不可空")
    private String defectType;
    @ApiModelProperty(value = "大小")
    private String size;
    @ApiModelProperty(value = "分布")
    private String distribution;
    @ApiModelProperty(value = "来源")
    private String source;
    @ApiModelProperty(value = "对策")
    private String countermeasure;
    @ApiModelProperty("数据时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime dataTime;
    @ApiModelProperty("溶解缺陷取样项目详情")
    @NotEmpty(message = "详情数据不可为空")
    @TableField(exist = false)
    @Valid
    private List<DefectSampleItemDetail> defectSampleItemDetail;
    @ApiModelProperty(value = "是否删除")
    @TableLogic
    private String isDelete;
}
